package com.flymobi.mshop.util;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.Application;

public class ActivityManager extends Application{
	private List<Activity> activityList = new ArrayList<Activity>();
	private static ActivityManager instance;
	private ActivityManager() {}
	
	public static ActivityManager getInstance(){
		if(null==instance){
			instance = new ActivityManager();
		}
		return instance;
	}
	
	public void addActivity(Activity activity){
		activityList.add(activity);
	}
	
	public void exit(){
		for(Activity activity:activityList){
			activity.finish();
		}
		System.exit(0);
	}
}
